﻿using Furion.SensitiveDetection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FurStudy.Core
{
    /// <summary>
    /// 自定义脱敏词汇检测器
    /// </summary>
    public class FurStudySensitiveDetectionProvider : ISensitiveDetectionProvider
    {
        /// <summary>
        /// 支持构造函数注入
        /// </summary>
        public FurStudySensitiveDetectionProvider()
        {
        }

        /// <summary>
        /// 返回所有脱敏词汇
        /// </summary>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task<IEnumerable<string>> GetWordsAsync()
        {
            // 这里写脱敏词汇数据的来源（如从数据库获取），建议做好缓存操作

            throw new NotImplementedException();
        }

        /// <summary>
        /// 判断脱敏词汇是否有效
        /// </summary>
        /// <param name="text"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task<bool> VaildedAsync(string text)
        {
            // 这里写如何判断是正常的字符，返回true正常，返回false表示是个脱敏词汇

            throw new NotImplementedException();
        }

        /// <summary>
        /// 替换脱敏词汇
        /// </summary>
        /// <param name="text"></param>
        /// <param name="transfer"></param>
        /// <returns></returns>
        /// <exception cref="NotImplementedException"></exception>
        public Task<string> ReplaceAsync(string text, char transfer = '*')
        {
            // 这里写替换非正常字符为指定字符

            throw new NotImplementedException();
        }
    }
}
